import { ApiCall } from "tsrpc";
import { ReqUpdateNumber, ResUpdateNumber } from "../../shared/protocols/Select/PtlUpdateNumber";
import { Global } from "../../Global";

export default async function (call: ApiCall<ReqUpdateNumber, ResUpdateNumber>) {
    // TODO
    const number = call.req.number
    const user = call.currentUser

    await Global.collection('users').updateOne({
        _id:user._id,
    },{
        $set:{
            number
        }
    })

    call.succ({
        
    })
}